/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lyn
 * Date: 2025-01-19
 * Time: 11:48
 */
class Method{
    public Method(){
        System.out.println("打印父类的构造方法");
    }
}
class Met extends Method{
    public Met(){
        //super();
        //注意子类构造方法中默认会调用父类的无参构造方法
        //用户没有写时，编译器会自动增加，而且super()必须是子类构造的第一条语句
        System.out.println("打印子类的构造方法");
    }
}
public class lyn1 {
    public static void main(String[] args) {
        Met met = new Met();
    }
}
